//引入axios封装方法
import http from '../axios';


//统一接口信息
//所有的请求全部统一在这里配置
//get请求示例,带参数
export const getUserInfo = (param) => http.get('url', param.id);
//get请求示例，不带参数
export const getUserList = () => http.get('url');
//post请求示例 带参数
export const validateLoginApi = (data) => http.post('validateLogin', data);
//post请求示例 不带参数
export const userlogout = () => http.post('url');
//建议使用的方法
//将post对象封装在一个form对象里，直接将对象作为参数传入
export const doMothed = (form) => http.post('url', form);

/**
 * 用户模块
 */
//用户登录
export const validateUser = (data) => http.post('validateUser', data);

//用户注册
// 1. 发送验证码
export const sendRegCode = (data) => http.post('sendRegCode',data);
// 2. 注册账号
export const regUser = (data) => http.post('regUser',data);

//获取所有用户信息用于管理
export const getAllUser = () => http.post('getalluser');

//获取所有用户信息的分页数据
export const getAllUserPagerData = (data) => http.post('getAllUserPagerData',data);

//获取用户角色列表
export const getUserRoleList = () => http.post('getUserRoleList');
//获取用户企业分类信息
export const getUserClassList = () => http.post('getUserClassList');
//根据用户id修改角色
export const updateUserRoleByUserId = (data) => http.post('updateUserRoleByUserId',data);

/**
 * 企业开户模块
 */
//申请开户
export const applyAccount = (data) => http.post('ApplyAccount',data);

//开户申请测试上传
export const addPostUpload = (data) => http.postFile('uploadpics',data);

//验证用户开户状态
export const validateApplyAccount = (data) => http.post('validateApplyAccount',data);

/**
 * 资产管理
 *  */
//获取企业资产数据和交易数据
export const getEnterprisePropertyDataAndTradeData = (data) => http.post('getEnterprisePropertyDataAndTradeData',data);
//订单交易发布接口
export const publishTradeOrder = (data) => http.post('publishTradeOrder',data);
//根据发布人id查询自身订单数据分页内容
export const getTradeOrderDataByPublishId = (data) => http.post('getTradeOrderDataByPublishId',data);
//确认订单发布
export const applyTradeOrder = (data) => http.post('applyTradeOrder',data);
//确认订单撤销
export const cancelTradeOrder = (data) => http.post('cancelTradeOrder',data);

/**
 * 交易市场
 * 
 */
//获取交易市场分页数据
export const getTradeMarketPagerData = (data) => http.post('getTradeMarketPagerData',data);
//交易买入
export const tradeBuyOrder = (data) => http.post('tradeBuyOrder',data);
//交易卖出
export const tradeSellOrder = (data) => http.post('tradeSellOrder',data);

/*
 审核关联
*/
//查询所有开户申请中的企业及账户信息
export const getApplyingEnterpriseDataMapper = (data) => http.post('getApplyingEnterpriseDataMapper',data);

//审核通过方法
export const CheckAccount =(data) => http.post('CheckAccount',data);

/**
 * 日志与统计
 */
//用户日志
export const getTradeRecordDataByCurrentUser = (data) => http.post('getTradeRecordDataByCurrentUser',data);

/**
 * 统计模块
 * 
 */
//获取首页数据统计
export const getDataAnalysisy = () => http.post('getDataAnalysisy');